﻿using Model;
using Model.Modules;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Proxy
{
    public class DataProxy
    {
        public bool IstestMode = ConfigurationManager.AppSettings["database"] != "es";

        public TestEntitity TestEntitity { get; set; }
        public ESDataHelper ESDataHelper { get; set; }

        public DataProxy(string mainid)
        {
            TestEntitity = new TestEntitity(mainid);
            ESDataHelper= new ESDataHelper();
        }

        public ObservableCollection<image> GetImagesByMainID(string main_id)
        {
            ObservableCollection<image> iamgelist;
            if (IstestMode)
                iamgelist = new ObservableCollection<image>(TestEntitity.Imagelist);
            else
                iamgelist = ESDataHelper.GetImagesByMainID(main_id);
            return iamgelist;
        }


    }
}
